home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / graphics / amicad / arexx_english / autosave.amicad < prev    next >
Text File  |  1999-12-06  |  1KB  |  52 lines

  1. /* Auto saving, © R.Florac, Version 2.02e, 22 mai 1999 */
  2.  
  3. port = address()
  4. options results
  5. signal ON error
  6.  
  7. cr = '0a'x
  8.  
  9. sauver_auto=getclip(sauvegarde.port)
  10. if sauver_auto=1 then do
  11.     a=setclip(sauvegarde.port,"")
  12.     'MESSAGE("Automatic saving"+CHR(10)+"interrupted.")'
  13.     exit
  14. end
  15.  
  16. if ~show('l', 'rexxsupport.library') then
  17. do
  18.     if ~addlib('rexxsupport.library',0,-30,0) then do
  19.     'MESSAGE("Install rexxsupport.library"+CHR(10)+"in your libs: drawer"+CHR(10)+"before using this script")'
  20.     exit
  21.     end
  22. end
  23.  
  24. a=setclip(sauvegarde.port,1)
  25. 'MESSAGE("An automatic saving"+CHR(10)+"all two minutes will be"+CHR(10)+"done if the contents of the"+CHR(10)+"current window has been modified."+CHR(10)+"Run this script again"+CHR(10)+"to stop his execution.")'
  26.  
  27. do forever
  28.     call delay(6000)
  29.     if ~show(p, port) then goto error
  30.     sauver_auto = getclip(sauvegarde.port)
  31.     if sauver_auto=1 then do
  32.     'MODIF(-1)'
  33.     if result=1 THEN do
  34.         'FILEPART("")'
  35.         if result="NoName" then do     /* Version 2.01 */
  36.         'REQUEST("Attention: the file"+CHR(10)+"has not been named, his"+CHR(10)+"saving is impossible"+CHR(10)+"Do you want to rename it?")'
  37.         if result<1 then exit
  38.         'MENU("Renommer")'
  39.         'FILEPART("")'
  40.         if result="NoName" then exit
  41.         end
  42.         'MENU("Save")'
  43.     end
  44.     end
  45.     else
  46.     exit
  47. end
  48.  
  49. error:
  50.     a=setclip(sauvegarde.port,"")
  51.     exit
  52.